﻿@model S4Store.Models.Imports.IndexModel
@{
    ViewBag.Title = "Index";
    Layout = null;
    S4Store.Domain.Administrator CurrentUser = (S4Store.Domain.Administrator)ViewBag.CurrentUser;
}
<style type="text/css">
#importwrap li{ list-style:none;}
#importwrap a{ text-decoration:none;}
#importwrap img{ border:none;}
#importwrap .box{ position:relative; width:197px; height:282px;}
#importwrap .pbg{ display:block; position:absolute; top:0; left:0; z-index:0; background: url(@Url.Content("~/Resources/project/v3/pbg.png")) no-repeat; width:197px; height:282px;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageloader(src="@Url.Content("~/Resources/project/v3/pbg.png")",sizingMethod="images"); }
#importwrap .pbox{ position:absolute; top:2px; left:2px; width:193px; height:278px; z-index:2;}
#importwrap .pti{ font-family:微软雅黑; font-size:18px; color:#0153a8; text-shadow:1px 1px 1px #ffffff; text-align:center; height:20px; line-height:20px; padding:15px 0;}
#importwrap .pti img{ vertical-align:middle; margin-right:5px;}
#importwrap .pn{ margin:0; padding:0;}
#importwrap .pn li{font-family:微软雅黑;margin:0; padding:0; text-align:center; border-bottom:1px dashed #ffffff;}
#importwrap .pn li a{ color:#636363; display:block; border-bottom:1px dashed #c2d2db; height:32px; line-height:32px;}
#importwrap .pn li a img{ vertical-align:middle; display:none;}
#importwrap .pn li a:hover{ color:#ff6000; zoom:1;}
#importwrap .pn li a:hover img{ vertical-align:middle; display:inline-block;}
#importwrap .dbox{ width:680px; height:200px; position:relative;}
#importwrap .dbg{display:block; position:absolute; top:0; left:0; z-index:1; background: url(@Url.Content("~/Resources/project/v3/sjbg.png")) no-repeat; width:395px; height:186px;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageloader(src="@Url.Content("~/Resources/project/v3/sjbg.png")",sizingMethod="images"); }
#importwrap .dico{display:block; position:absolute; top:0; right:0; z-index:0; background: url(@Url.Content("~/Resources/project/v3/ico.png")) no-repeat; width:302px; height:163px;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageloader(src="@Url.Content("~/Resources/project/v3/ico.png")",sizingMethod="images"); }
#importwrap .dcont{ position:absolute; top:10px; left:10px; z-index:10; width:330px;}
#importwrap .pti2{ font-family:微软雅黑; font-size:14px; color:#0153a8; text-shadow:1px 1px 1px #ffffff;height:20px; line-height:20px; padding:15px 0;}
#importwrap .pti2 img{ vertical-align:middle; margin-right:5px;}
#importwrap .pn2{ margin:0; padding:0;}
#importwrap .pn2 li{font-family:微软雅黑;margin:0; padding:0;}
#importwrap .pn2 li a{ color:#636363; display:block; height:32px; line-height:32px; background: url(@Url.Content("~/Resources/project/v3/arr.gif")) no-repeat left; padding-left:12px; }
#importwrap .pn2 li a:hover{background: url(@Url.Content("~/Resources/project/v3/aR.gif")) no-repeat left; color:#ff6000;}
#importwrap #file_upload{ width:130px; display: inline-block; float: right;}
</style>
<div style=" height:100%; width:100%; overflow:hidden;background: url(/Resources/project/ohbg.jpg)" class="verticalSplitContainer" id="importwrap" >
<form class="pageForm addpage" action="@Url.Action("ImportFile")" method="post" id="importform"  successmsg="导入成功">
    @Html.Action("ReportBar", "Common", Model.BarModel)
    <div style=" padding: 25px 0 0 25px">
 <table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
        <div class="dbox">
            <span class="dico"></span>
            <span class="dbg"></span>
            <div class="dcont">
                <table width="100%" border="0" cellspacing="10" cellpadding="0">
                  <tr>
                    <td>日期：</td>
                    <td><input type="text"  readonly="readonly" name="importdate" id="import_date" class="datetime" style="height:20px; width:80px; margin-right:10px; border:1px solid #B8D0D6;"  />  </td>
                    <td>车型</td>
                      <td>
                      <select name="importtype" id="import_type" style="border:1px solid #b5bec3; height:22px; line-height:22px;  " >
                       @if (
                           CurrentUser.Position == S4Store.Domain.Position.DataEntryClerk || CurrentUser.Position == S4Store.Domain.Position.SystemManager)
                       {
                           <option>车型KPI</option>
                           <option>展厅销售KPI</option>
                           <option>电话销售KPI</option>
                       }
                       @if (
                           CurrentUser.Position == S4Store.Domain.Position.MarktingDataEntryClerk || CurrentUser.Position == S4Store.Domain.Position.SystemManager)
                       {
                           <option>电销信息管理数据</option>
                           <option>网络营销数据</option>
                       }
                       @if (
                           CurrentUser.Position == S4Store.Domain.Position.FinancialDataEntryClerk || CurrentUser.Position == S4Store.Domain.Position.SystemManager)
                       {
                           <option>财务数据</option>
                       }
                    
                       @if (
                           CurrentUser.Position == S4Store.Domain.Position.AfterSaleDataEntryClerk || CurrentUser.Position == S4Store.Domain.Position.SystemManager)
                       {
                           <option>售后车型KPI</option>
                           <option>售后用品销售</option>
                           <option>售后服务顾问</option>
                           <option>售后车间主管</option>
                           <option>售后客服专员</option>
                       }
                   </select>
                      
                      </td>
                  </tr>
                  <tr>
                    <td colspan="4"><input type="text" name="importfilepath" id="import_filepath" readonly="readonly" style="height:20px; border:1px solid #B8D0D6; margin-right:10px" /> &nbsp;&nbsp;&nbsp;&nbsp;<input type="file" id="file_upload" /></td>
                  </tr>
                  <tr>
                    <td colspan="4"><input style="background:url(@Url.Content("~/Resources/project/v3/btn.gif")) no-repeat; width:84px; height:30px; border:none; cursor:pointer;" name="" type="button" class="submit"/></td>
                  </tr>
                </table>
            </div>
        </div>
    </td>
  </tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
    <tr>
                    @if (
                        CurrentUser.Position == S4Store.Domain.Position.DataEntryClerk || CurrentUser.Position == S4Store.Domain.Position.SystemManager)
                    {
                        <td valign="top" style="padding: 0 20px; border-right: 1px dashed #b4c1cb;">
                            <div class="pti2"><img src="@Url.Content("~/Resources/project/v3/pi1.gif")" width="20" height="18" />销售数据模板</div>
                            <ul class="pn2">
                                <li><a href="/Templates/Import/车型KPI(2013-1-1).xlsx">车型销售KPI</a></li>
                                <li><a href="/Templates/Import/展厅销售KPI(2013-1-1).xlsx">展厅销售KPI</a></li>
                                <li><a href="/Templates/Import/电话销售KPI(2013-1-1).xlsx">电话销售KPI</a></li>
                            </ul>
                        </td>
                    }
                    @if (
                        CurrentUser.Position == S4Store.Domain.Position.MarktingDataEntryClerk || CurrentUser.Position == S4Store.Domain.Position.SystemManager)
                    {
                        <td valign="top" style="padding: 0 20px; border-right: 1px dashed #b4c1cb; border-left: 1px dashed #ffffff;" >
                            <div class="pti2"><img src="@Url.Content("~/Resources/project/v3/pi2.gif")" width="20" height="18" />营销数据模板</div>
                            <ul class="pn2">
                                <li><a href="/Templates/Import/电销信息管理数据(2013-1-1).xlsx">电销信息管理数据&nbsp;</a></li>
                                <li><a href="/Templates/Import/网络营销数据(2013-1-1).xlsx">网络营销KPI&nbsp;</a></li>
                            </ul>
                        </td>
                    }
                    
                    @if (
                        CurrentUser.Position == S4Store.Domain.Position.FinancialDataEntryClerk || CurrentUser.Position == S4Store.Domain.Position.SystemManager)
                    {
                        <td valign="top" style="padding: 0 20px; border-right: 1px dashed #b4c1cb; border-left: 1px dashed #ffffff;">
                            <div class="pti2"><img src="@Url.Content("~/Resources/project/v3/pi3.gif")" width="16" height="18" />财务数据模板</div>
                            <ul class="pn2">
                                <li><a href="/Templates/Import/财务数据(2013-1-1).xlsx">财务数据报表</a></li>
                            </ul>
                        </td>
                    }
                    @if (
                        CurrentUser.Position == S4Store.Domain.Position.AftersalesManager || CurrentUser.Position == S4Store.Domain.Position.SystemManager)
                    {
                        <td valign="top" style="padding: 0 20px; border-left: 1px dashed #ffffff;">
                            <div class="pti2"><img src="@Url.Content("~/Resources/project/v3/pi4.gif")" width="22" height="18" />售后数据模板</div>
                            <ul class="pn2">
                                <li><a href="/Templates/Import/售后车型.xlsx">售后业绩车型KPI</a></li>
                                <li><a href="/Templates/Import/用品销售.xlsx">用品销售KPI</a></li>
                                <li><a href="/Templates/Import/服务顾问.xlsx">服务顾问KPI</a></li>
                                <li><a href="/Templates/Import/车间主管.xlsx">车间主管KPI</a></li>
                                <li><a href="/Templates/Import/客服专员.xlsx">客户专员KPI</a></li>
                            </ul>
                        </td>
                    }
    </tr>
</table>
    
    
    </div>

        <script>
            $(function () {
                


                $("#file_upload").uploadify({
                    height: 20,
                    swf: '/Resources/uploadify/scripts/uploadify.swf',
                    uploader: '/Upload/Xls',
                    width: 130,
                    buttonText: "选择本机Excel文件",
                    uploadLimit: 999,
                    queueSizeLimit: 999,
                    fileTypeExts: "*.xls;*.xlsx",
                    fileTypeDesc: "Excel文件",
                    queueID:"import_queueID",
                    onUploadSuccess: function (a, rdata) {
                        eval("var data=" + rdata);
                        $("#import_filepath").val(data.url);
                        var filename = data.filename.replace("（", "(").replace("）", ")");
                        filename = filename.replace("(", "|").replace(")", "");
                        if (filename.indexOf(".") == -1) {
                            return;
                        }
                        var fileindex = filename.indexOf(".");
                        filename = filename.substring(0, fileindex);
                        if (filename.indexOf("|") != -1) {
                            var arr = filename.split("|");
                            $("#import_date").val(arr[1]);
                            $("#import_type").val(arr[0]);
                        }
                    }
                });

                setInterval(function () {
                    $("#importform select[name='StoreId']").unbind();
                }, 1000);
            });
        </script>
</form>
</div>
